﻿@model Core_Goods
@{
    ViewBag.ParentUrl = "/Goods/Edit";
    ViewBag.Title = "编辑商城宝贝";
}
@section header{
}
@section breadcrumb
{
    <ul class="breadcrumb">
        <li>
            <i class="ace-icon fa fa-home home-icon"></i>
            <a href="/">首页</a>
        </li>
        <li>
            <a href="/Goods/Index">商品管理</a>
        </li>
        <li class="active">@ViewBag.Title</li>
    </ul><!-- .breadcrumb -->
}
<div class="col-sm-10">

    <form class="form-horizontal" role="form" id="frm" method="POST" novalidate="novalidate" action="/Goods/Edit">
        <div class="tabbable">
            <ul class="nav nav-tabs padding-16">
                <li class="active">
                    <a data-toggle="tab" href="#edit-basic">
                        <i class="green ace-icon fa fa-pencil-square-o bigger-125"></i>
                        基本信息
                    </a>
                </li>
                <li>
                    <a data-toggle="tab" href="#edit-content">
                        <i class="purple ace-icon fa fa-cog bigger-125"></i>
                        详细介绍
                    </a>
                </li>
            </ul>
        </div>
        <div class="tab-content profile-edit-tab-content">
            <div id="edit-basic" class="tab-pane in active">
                @Html.HiddenFor(o => o.G_Id)
                @*<h4 class="header blue bolder smaller">
                         活动图片
                         <small id="uploadTips">
                         </small>
                     </h4>
                    <div class="row">
                         <!-- 封面、图片 -->
                         <div class="col-xs-12 col-sm-6 center">
                             <div class="form-group">
                                 <label class="col-sm-3 control-label no-padding-right"> 活动封面 </label>
                                 <div class="col-sm-9" style="text-align:left;">
                                     <img id="imgA_Images" src="@string.Format("{0}", string.IsNullOrEmpty(Model.A_Images) ? "/static/img/uploadpic.png" : "/cache"+Model.A_Images)" width="135" height="120" style="width: 135px;height:113px;" alt="" />
                                     @Html.HiddenFor(o => o.A_Images)
                                 </div>
                             </div>
                         </div>
                         <!-- LOGO、图片 -->
                         <div class="col-xs-12 col-sm-6 center">
                             <div class="form-group">
                                 <label class="col-sm-3 control-label no-padding-right"> 活动LOGO </label>
                                 <div class="col-sm-9" style="text-align:left;">
                                     <img id="imgA_Logo" src="@string.Format("{0}", string.IsNullOrEmpty(Model.A_Logo) ? "/static/img/uploadpic.png" : "/cache" + Model.A_Logo)" width="135" height="120" style="width: 135px;height:113px;" alt="" />
                                     @Html.HiddenFor(o => o.A_Logo)
                                 </div>
                             </div>
                         </div>
                     </div>
                                <hr />*@

                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right"> 封面图片URL </label>
                    <div class="col-sm-9">
                        @Html.TextBoxFor(o=>Model.G_Img, new { @class = "col-xs-12 col-sm-10", placeholder = "封面图片URL", required = "required" })
                    </div>
                </div>
                <div class="space-4"></div>
                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right"> 多张封面图片URL</label>
                    <div class="col-sm-9">
                        <textarea class="col-xs-12 col-sm-10" id="coverImgs" name="coverImgs" placeholder="多张封面图片URL，如：url1,url2" type="text"></textarea>
                    </div>
                </div>
                <div class="space-4"></div>
                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right"> 商品名 </label>
                    <div class="col-sm-9">
                        @Html.TextBoxFor(o => o.G_Name, new { @class = "col-xs-12 col-sm-10", placeholder = "商品名", required = "required", data_max = "20" })
                    </div>
                </div>
                <div class="space-4"></div>
                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right"> 类型 </label>
                    <div class="col-sm-9">
                        @Html.DropDownListFor(o => o.G_TypeId, (IEnumerable<SelectListItem>)TempData["GoodsType"], new { @class = "col-xs-5 col-sm-10", required = "required" })
                    </div>
                </div>

                <div class="space-4"></div>
                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right"> 折扣价 </label>
                    <div class="col-sm-9">
                        @Html.TextBoxFor(o => o.G_PriceDeposit, new { @class = "col-xs-12 col-sm-10", placeholder = "折扣价", required = "required", type = "number" })
                    </div>
                </div>

                <div class="space-4"></div>
                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right"> 原价 </label>
                    <div class="col-sm-9">
                        @Html.TextBoxFor(o => o.G_Price, new { @class = "col-xs-12 col-sm-10", placeholder = "原价", required = "required", type = "number" })
                    </div>
                </div>


                <div class="space-4"></div>
                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right"> 花语 </label>
                    <div class="col-sm-9">
                        @Html.TextBoxFor(o => o.G_Tips, new { @class = "col-xs-12 col-sm-10", placeholder = "花语" })
                    </div>
                </div>


                <div class="space-4"></div>
                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right">浏览量</label>
                    <div class="col-sm-9">
                        @Html.TextBoxFor(o => o.G_Clicks, new { @class = "col-xs-5 col-sm-5", placeholder = "点击次数", required = "required", type = "number", min = "0" })
                    </div>
                </div>


                <div class="space-4"></div>
                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right">库存</label>
                    <div class="col-sm-9">
                        @Html.TextBoxFor(o => o.G_RemainCount, new { @class = "col-xs-5 col-sm-5", placeholder = "库存", required = "required", type = "number", min = "0" })
                    </div>
                </div>


                <div class="space-4"></div>
                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right">销量</label>
                    <div class="col-sm-9">
                        @Html.TextBoxFor(o => o.G_Sales, new { @class = "col-xs-5 col-sm-5", placeholder = "销量", required = "required", type = "number", min = "0" })
                    </div>
                </div>


                <div class="space-4"></div>
                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right">简介描述</label>
                    <div class="col-sm-9">
                        @Html.TextAreaFor(o => o.G_Desc, new { @class = "col-xs-12 col-sm-10", placeholder = "商品的简要描述" })
                    </div>
                </div>

                <div class="space-4"></div>
                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right"> 标签 </label>
                    <div class="col-sm-9">
                        @Html.TextBoxFor(o => o.G_Tags, new {@class = "col-xs-12 col-sm-10", placeholder = "商品标签"})
                    </div>
                </div>


                <div class="space-4"></div>
                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right">邮费</label>
                    <div class="col-sm-9">
                        @Html.TextBoxFor(o => o.G_ExtraFee, new { @class = "col-xs-5 col-sm-5", placeholder = "邮费", required = "required", type = "number", min = "0" })
                    </div>
                </div>

                <div class="space-4"></div>
                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right">其他备注</label>
                    <div class="col-sm-9">
                        @Html.TextAreaFor(o => o.G_Remark, new {@class = "col-xs-12 col-sm-10", placeholder = "其他备注" })
                    </div>
                </div>

                <div class="space-4"></div>
                <h4 class="header blue bolder smaller">商品标识</h4>
                <div class="space-4"></div>
                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right">首页置顶</label>
                    <div class="col-sm-9">
                        <label class="inline">
                            <input name="G_Top" type="radio" class="ace" value="0" required />
                            <span class="lbl middle"> 否</span>
                        </label>
                        &nbsp; &nbsp; &nbsp;
                        <label class="inline">
                            <input name="G_Top" type="radio" class="ace" value="1" />
                            <span class="lbl middle"> 是</span>
                        </label>
                    </div>
                </div>
                <div class="space-4"></div>
                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right">掌柜推荐</label>
                    <div class="col-sm-9">
                        <label class="inline">
                            <input name="G_Recom" type="radio" class="ace" value="0" required />
                            <span class="lbl middle"> 否</span>
                        </label>
                        &nbsp; &nbsp; &nbsp;
                        <label class="inline">
                            <input name="G_Recom" type="radio" class="ace" value="1" />
                            <span class="lbl middle"> 是</span>
                        </label>
                    </div>
                </div>
                <div class="space-4"></div>
                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right">状态</label>
                    <div class="col-sm-9">
                        <label class="inline">
                            <input name="G_Status" type="radio" class="ace" value="0" required />
                            <span class="lbl middle"> 上架</span>
                        </label>
                        &nbsp; &nbsp; &nbsp;
                        <label class="inline">
                            <input name="G_Status" type="radio" class="ace" value="1" />
                            <span class="lbl middle"> 下架</span>
                        </label>
                    </div>
                </div>
            </div>

            <div id="edit-content" class="tab-pane">
                <div class="space-8"></div>
                <div class="form-group">
                    <h4 class="header blue">详情描述</h4>
                    <!-- 加载编辑器的容器 -->
                    @Html.TextAreaFor(o => o.G_Content)
                </div>
                <div class="space-8"></div>
                <div class="form-group">
                    <h4 class="header blue">规格参数</h4>
                    <!-- 加载编辑器的容器 -->
                    @Html.TextAreaFor(o => o.G_SizeAbout)
                </div>
            </div>
        </div>
        <div class="space-4"></div>
        <div class="clearfix form-actions">
            <div class="col-md-offset-3 col-md-9">
                <button class="btn btn-info" type="submit">
                    <i class="ace-icon fa fa-check bigger-110"></i>
                    提交
                </button>
                &nbsp; &nbsp; &nbsp;
                <button class="btn" type="reset">
                    <i class="ace-icon fa fa-undo bigger-110"></i>
                    重置
                </button>
            </div>
        </div>
        <div class="hr hr-24"></div>
    </form>
</div><!-- /.span -->
@section footerScript
{

    <script src="/assets/js/validation/jquery-html5Validate.js"></script>
    <!--富文本编辑器  配置文件 -->
    <script type="text/javascript" src="/assets/js/editor/xheditor.min.js"></script>
    <script type="text/javascript" src="/assets/js/editor/xheditor_lang/zh-cn.js"></script>
    <script src="/js/common.js"></script>
}
@section footer
{
    <script>
        $('#G_Content').xheditor({
            tools: 'full',
            width: '98%',
            height: '320px',
            upImgUrl: '/Editor/UploadFile',
            upImgExt: 'jpg,jpeg,gif,png'
        });
        $('#G_SizeAbout').xheditor({
            tools: 'full',
            width: '98%',
            height: '320px',
            upImgUrl: '/Editor/UploadFile',
            upImgExt: 'jpg,jpeg,gif,png'
        });
        $(function () {
            //各种状态选中
            var show = @Model.G_Top
            show = show || 0;
            $('input[name="G_Top"][value="' + show + '"]').prop("checked", true);

            var top = @Model.G_Status
            top = top || 0;
            $('input[name="G_Status"][value="' + top + '"]').prop("checked", true);


            var state = @Model.G_Recom
            state = state || 0;
            $('input[name="G_Recom"][value="' + state + '"]').prop("checked", true);

        });
        $("#frm").html5Validate(function () {
            this.submit();
        }, {
            // novalidate: false,
            // labelDrive: false
        });
    </script>
}
